package Application.MapApplication.manager
{
	import Application.MapApplication.def.Def;
	import Application.MapApplication.def.Manager;
	import Application.MapApplication.model.MapEditScenePry;
	import Application.MapApplication.view.scene.MapEditSceneMed;
	import Application.MapApplication.view.scene.PreLoadingMed;
	import Application.MapApplication.view.ui.MainTopMed;
	
	import def.XG;

	public class SceneManager
	{
		public var group : Object;
		
		public static const SceneId_PreLoading : int = 0;
		public static const SceneId_MapMedit : int = 1;
		
		public function SceneManager()
		{
			
		}
		
		public function IntoScene(sceneId : int) : void
		{
			switch(sceneId)
			{
				case 0:
					intoPreLoadingScene();
					break;
				case 1:
					intoMapEditScene();
					break;
			}
		}
		
		/**预加载场景**/
		private function intoPreLoadingScene():void
		{
			XG.openUI(Def.PreloadingScene,PreLoadingMed);
			
			Manager.Source.loadGameSource(loadSourceCallBack);
		}
		
		/***资源加载回调*/
		private function loadSourceCallBack() : void
		{	
			XG.closeUI(Def.PreloadingScene);
			
			Manager.Stage.init();
		}
		
		/** 
		 * 地图编辑场景"MapEditSceneMed"
		 */		
		private function intoMapEditScene() : void
		{
			XG.openUI(MapEditSceneMed.NAME,MapEditSceneMed);
			
			XG.openUI(Def.MainTop,MainTopMed);
		}
		
	}
}